home *** CD-ROM | disk | FTP | other *** search
- global gNewShortNameList
-
- on hbuildshortname pListOFentries, pThisMode, pWriteToThis
- set vTHeseEntries to []
- set gNewList to [:]
- set vPropertLIst to [:]
- set vDUPlist to []
- set gNewShortNameList to []
- set vTHeseEntries to hReadIt(pListOFentries)
- set vTHeseEntries to value(vTHeseEntries)
- set vMax to count(vTHeseEntries)
- set vThisLUList to hReadInLU(pThisMode)
- repeat with x = 1 to vMax
- set vthisPRop to getAt(vTHeseEntries, x)
- set vNewShortName to hMakeShortName(vthisPRop, pThisMode)
- add(gNewShortNameList, vNewShortName)
- addProp(vPropertLIst, vNewShortName, vthisPRop)
- hputmsg(vNewShortName)
- end repeat
- hputmsg("these are duplicates " && vDUPlist)
- if pThisMode = #ENCY then
- hWriteAlph(vPropertLIst, pWriteToThis)
- else
- hWriteThis(vPropertLIst, pWriteToThis)
- end if
- end
-
- on hCheckLUforFinalDups pThisCast
- set vFixthese to []
- set vCastList to value(the text of cast pThisCast)
- repeat with x = 1 to count(vCastList)
- set vShortName to getPropAt(vCastList, x)
- set vHoldcount to 0
- repeat with p = 1 to count(vCastList)
- set vNextShortname to getPropAt(vCastList, p)
- if vShortName = vNextShortname then
- set vHoldcount to vHoldcount + 1
- if vHoldcount > 1 then
- add(vFixthese, vShortName)
- end if
- end if
- end repeat
- end repeat
- hputmsg("these are dups fix them manually" && vFixthese)
- end
-
- on hCheckLUforFinalDupsALL pThisCast, pEndCast
- set vFixthese to []
- repeat with z = pThisCast to pEndCast
- set vCastList to value(the text of cast z)
- repeat with x = 1 to count(vCastList)
- set vShortName to getPropAt(vCastList, x)
- set vHoldcount to 0
- repeat with p = 1 to count(vCastList)
- set vNextShortname to getPropAt(vCastList, p)
- if vShortName = vNextShortname then
- set vHoldcount to vHoldcount + 1
- if vHoldcount > 1 then
- add(vFixthese, vShortName)
- end if
- end if
- end repeat
- end repeat
- hputmsg("these are dups fix them manually" && vFixthese)
- hputmsg("working on cast num" && z - 1)
- end repeat
- end
-
- on hWriteAlph pthisString, pthisName
- set gAlphText to [:]
- set gtheText to [:]
- repeat with p = charToNum("A") to charToNum("Z")
- set gtheText to pthisString
- sort(gtheText)
- set vstartHere to numToChar(p)
- set vendHere to numToChar(p + 1)
- repeat with n = findPosNear(gtheText, vstartHere) to findPosNear(gtheText, vendHere) - 1
- addProp(gAlphText, getPropAt(gtheText, n), getAt(gtheText, n))
- end repeat
- hWriteThis(gAlphText, pthisName & numToChar(p))
- set gAlphText to [:]
- end repeat
- end
-
- on hWriteThis pthisString, pthisName
- set pthisString to string(pthisString)
- set gWriteObject to FileIO(mnew, "write", the pathName & pthisName)
- set gtheText to pthisString
- set newText to value(gtheText)
- set reallyText to string(newText)
- gWriteObject(mWriteString, reallyText)
- gWriteObject(mdispose)
- hputmsg("Wrote a file named " & pthisName & "******************" & RETURN)
- end
-
- on hMakeShortName pThisLongName, pThisMode
- set vCleanLongName to hZappedForShortNames(pThisLongName)
- set vLengthLongName to length(vCleanLongName)
- if pThisMode = #ENCY then
- set vShortName to char 1 to 3 of vCleanLongName & char vLengthLongName - 1 to vLengthLongName of vCleanLongName & "B"
- if length(vShortName) < 6 then
- set vShortName to char 1 to 3 of vCleanLongName & char vLengthLongName - 1 to vLengthLongName of vCleanLongName & "_B"
- if length(vShortName) < 6 then
- hputmsg("••••• less than six")
- end if
- end if
- end if
- if pThisMode = #CHRO then
- if char 1 to 3 of vCleanLongName = "The" then
- set vShortName to "C" & char 4 to 6 of vCleanLongName & char vLengthLongName - 1 to vLengthLongName of vCleanLongName
- hputmsg("skipping the now is vShortName" && vShortName)
- else
- set vShortName to "C" & char 1 to 3 of vCleanLongName & char vLengthLongName - 1 to vLengthLongName of vCleanLongName
- end if
- end if
- if pThisMode = #EPIS then
- set vShortName to "E" & char 1 to 3 of vCleanLongName & char vLengthLongName - 1 to vLengthLongName of vCleanLongName
- end if
- return vShortName
- end
-
- on hReadInLU pWhatMode
- set gEntireLUList to hMakeListFromCast(641, 666)
- set vBeginShortCastMem to the number of cast "LU_A_ENCY"
- set vEndShortCastMem to the number of cast "LU_Z_ENCY"
- if pWhatMode = #ENCY then
- set vBeginCastMem to the number of cast "ATTRIB_A_ENCY"
- set vEndCastMem to the number of cast "ATTRIB_Z_ENCY"
- end if
- if pWhatMode = #EPIS then
- set vBeginCastMem to the number of cast "ATTRIB_A_EPIS"
- set vEndCastMem to the number of cast "ATTRIB_3_EPISSUB"
- end if
- if pWhatMode = #CHRO then
- set vBeginCastMem to the number of cast "ATTRIB_18_CHRO"
- set vEndCastMem to the number of cast "ATTRIB_24_CHRO"
- end if
- set vThisLUList to hMakeListFromCast(vBeginShortCastMem, vEndShortCastMem)
- return vThisLUList
- end
-
- on hCheckForDupes pWhatShortName
- set vLUlist to the text of cast ("LU_" & char 1 of pWhatShortName & "_ENCY")
- set vLUlist to value(vLUlist)
- set vValue to getaProp(vLUlist, pWhatShortName)
- if stringp(vValue) then
- return vValue
- end if
- end
-
- on hZappedForShortNames x
- if voidp(x) then
- return
- end if
- set x to hZapThroughOut(x, 40)
- set x to hZapThroughOut(x, 91)
- set x to hZapThroughOut(x, 41)
- set x to hZapThroughOut(x, 93)
- set x to hZapThroughOut(x, 59)
- set x to hZapThroughOut(x, 58)
- set x to hZapThroughOut(x, 32)
- set x to hZapThroughOut(x, 210)
- set x to hZapThroughOut(x, 39)
- set x to hZapThroughOut(x, 45)
- set x to hZapThroughOut(x, 212)
- set x to hZapThroughOut(x, 211)
- set x to hZapThroughOut(x, 44)
- set x to hZapThroughOut(x, 46)
- set x to hZapThroughOut(x, 39)
- set x to hZapThroughOut(x, 213)
- set x to hZapThroughOut(x, 33)
- set x to hZapThroughOut(x, 63)
- set x to hZapThroughOut(x, 142)
- set x to hZapThroughOut(x, 137)
- set x to hZapSpecialCase(x)
- return x
- end
-
- on hWehaveaShortName pB, pE
- set gOutLIST to []
- hTHisList()
- set gEntireNameList to hMakeListFromCast(pB, pE)
- set gEntireNameList to value(gEntireNameList)
- set vMax to count(gStevesList)
- repeat with x = 1 to count(gStevesList)
- set vthisPRop to getAt(gStevesList, x)
- set vthisshortname to hChangetoShortorVOid(vthisPRop, gEntireNameList, gOutLIST)
- hputmsg("this many left " & vMax - x)
- end repeat
- end
-
- on hChangetoShortorVOid vEntryName, vthisList, pOutputlist
- set vthisList to value(vthisList)
- set vValue to getaProp(vthisList, vEntryName)
- if voidp(vValue) then
- add(pOutputlist, vEntryName)
- end if
- hputmsg(pOutputlist)
- end
-
- on hTHisList
- end
-